package com.module.lemlin.owner

import android.view.LayoutInflater
import androidx.viewbinding.ViewBinding
import java.lang.Exception

abstract class OwnerViewBindingActivity<VB : ViewBinding> :
    OwnerAbstractActivity() {

    private var _binding: VB? = null

    val mViewBinding get() = _binding
        ?: throw Exception("View is not binding")

    abstract val inflate: (LayoutInflater) -> VB

    override fun doBeforeInit() {
        _binding = inflate(layoutInflater)
        setContentView(_binding?.root)
    }

    override fun onDestroy() {
        super.onDestroy()
        _binding = null
    }
}